Nominal values attribute fix#508
Nominal values attribute fix#508maxcopeland wants to merge 2 commits intoopenml:developfrom maxcopeland:nominal_vals_attrib_fix
Conversation
…mlfeature to source of nominal values
Codecov Report
@@ Coverage Diff @@
## develop #508 +/- ##
==========================================
+ Coverage 89.59% 89.6% +0.01%
==========================================
Files 32 32
Lines 2815 2819 +4
==========================================
+ Hits 2522 2526 +4
Misses 293 293
Continue to review full report at Codecov.
|
| # split string of nominal values into type list if feature is nominal | ||
| # otherwise passing none for nominal values | ||
| try: | ||
| nom_vals = [str(x[1:-1]) for x in xmlfeature['oml:nominal_values'][1:-1].split(',')] |
There was a problem hiding this comment.
Could you please add a brief explanation of this statement, preferably with an example string that is parsed?
|
Thanks a lot for tackling this @maxcopeland. Please excuse the long wait time, but I was busy for the last few days finishing up a paper. In addition to my comment, could you please:
@janvanrijn is there a reason that this is passed as a python-list-like string and not as a proper XML list? I assume the second one would be easier to handle by the client APIs as the parsing is handled by XML libraries. |
|
@mfeurer no particular reason, if you prefer an xml list we can discuss it next week at the Hackathon? |
|
I definitively prefer the list to be in XML, because we can then rely on standard libraries to do the parsing. If the list is stored like it is stored right now, this requires custom parsing on the client side, which we should definitively avoid. |
|
No problem. Should I rewrite the parsing to expect xml list in |
|
Thanks for your offer. I'm afraid we first need to discuss how to expect such information from the server and then implement this. We will come back to you next week. |
|
Okay, sounds good. Just let me know once there's a consensus and I'll make the necessary changes. |
|
@janvanrijn just finished implementing getting the nominal values as an XML list. Could you please try again @maxcopeland ? |
|
@mfeurer Great. Sure-- I'll get started. |
|
Superseded by #644. |
Reference Issue
Fixes #507
Adds list of nominal values to be passed to
OpenMLDataFeatureconstructor in setting theOpenMLDataset.featureattributeWhat does this PR implement/fix? Explain your changes.
Creates
nom_valvariable to store list of nominal variables if feature is nominal, storesNoneotherwise, thennom_valis passed toOpenMLDataFeatureconstructorHow should this PR be tested?
Any other comments?
xmlfeature['oml:nominal_values']contains list as string type (e.g. `"['A', 'B', 'C', 'D']"), thus the use of splitting, lambda